export interface SubWorldConfigItem {
    /**
     * @en subworld id
     * @zh 子世界ID 
    */
    id: string,
    /**
     * @en name for displaying
     * @zh 显示名称
    */
    name: string,

    /**
     *@en scene of subworld
     *@zh 子世界场景
    */
    scene: string,
    /**
     * @en bundle where the scene file locates.
     * @zh 场景文件所在的 bundle
    */
    bundle: string,
    /**
     * @en level data of subworld, can be config file,prefab or json data.
     * @zh 子世界关卡配置, 配置文件/Prefab/JSON 数据
     * 
     * */
    levelData: any,

    /**
     * @en whether it is public, subworld marked as public only has one copy in the system. and won't be destroyed.
     * @zh 是否为公共子世界，公共世界只有一份且不会被销毁
     **/
    isPublic: boolean,
}

const _subWorldMap = {} as any;

const _subWorldList = [
    /***
     * @en public subworlds
     * @zh 公共子世界
     */

    /**
     * @en private subworlds, are used as dungeon,room,moba levels. could be created and destroyed depends on needs.
     * @zh 私人子世界，用于副本，房间类玩法。可根据情况自行创建和销毁 
    */
    { id: 'billiards', name: 'Billiards Game', scene: 'game_billiards', bundle: 'module_billiards', isPublic: false, levelData: null },
    { id: 'gomoku', name: 'Gomoku Game', scene: 'game_gomoku', bundle: 'module_gomoku', isPublic: false, levelData: null },
    /**
     * @en special usage for lobby connection.
     * @zh 特殊用途，用于大厅长链接
     * */
    { id: 'lobby', name: 'lobby', scene: '', bundle: '', isPublic: false, levelData: null },
];


for (let i = 0; i < _subWorldList.length; ++i) {
    let subWorldItem = _subWorldList[i];
    _subWorldMap[subWorldItem.id] = subWorldItem;
}

export class SubWorldConfig {
    public static getSubWorldConfig(subWorldId: string): SubWorldConfigItem {
        return _subWorldMap[subWorldId];
    }
}

